import Vue from 'vue';
import serverVue from './main.vue';

let LoadingConstructor,instance;

const serverDialog = function(options) {
	LoadingConstructor = Vue.extend(serverVue);
	instance = new LoadingConstructor({
		data: options
	});
	instance.vm = instance.$mount();
	document.body.appendChild(instance.vm.$el);

	return instance.vm;
}

serverDialog.show = options => {
	console.log(options)
	return serverDialog({errorData: options});
}

export default serverDialog;